import 'package:flutter/cupertino.dart';
import 'package:lottie/lottie.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

/// lottie动画上拉加载更多
class GTLoadMoreFooter extends StatelessWidget {
  const GTLoadMoreFooter({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return CustomFooter(
      builder: (BuildContext context, LoadStatus? mode) {
        if (mode == LoadStatus.noMore || mode == LoadStatus.idle || mode == LoadStatus.failed) {
          return const SizedBox(height: 20);
        }
        return Padding(
          padding: const EdgeInsets.symmetric(vertical: 20),
          child: Lottie.asset('packages/lib_uikit/assets/json/gt_refresh_footer.json', width: 20, height: 20),
        );
      },
    );
  }
}
